package com.financial.service.sysconfig.service.impl;

import com.financial.service.sysconfig.constants.FinancialSysconfigRouteEnumConstants;
import com.financial.service.sysconfig.util.apiresult.ApiResult;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.financial.service.sysconfig.dao.FinancialSysconfigRouteDao;
import com.financial.service.sysconfig.domain.FinancialSysconfigRouteDO;
import com.financial.service.sysconfig.service.FinancialSysconfigRouteService;



@Service
public class FinancialSysconfigRouteServiceImpl implements FinancialSysconfigRouteService {
	@Autowired
	private FinancialSysconfigRouteDao financialSysconfigRouteDao;

	/**
	 * 通过业务类型获取对应的路由
	 * @param businessType
	 * @return
	 */

	@Override
	public ApiResult getRoutePath(String businessType) {
		String isOpen=FinancialSysconfigRouteEnumConstants.ENUM_ISOPEN_OPEN;
		String routePath=financialSysconfigRouteDao.getRoutePath(businessType,isOpen);
		if(StringUtils.isBlank(routePath)){
			return	ApiResult.failure(FinancialSysconfigRouteEnumConstants.ENUM_ROUTEPATH_FAIL);
		}
		return ApiResult.success(routePath);
	}
}
